<template>
	<view class="my-settlt-contaitor">
		<!-- 全选 -->
		<label @click="changeAllState" class="radio">
			<radio color="#C00000" :checked="isFullCheck" /><text>全选</text>
		</label>

		<!-- 合计 -->
		<view class="amount-box">
			合计: <text class="amount">${{checkedGoodsAmount}}</text>
		</view>
		<!-- 结算按钮 -->
		<view class="btn-settle">
			结算{{checkedCount}}
		</view>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: "my-settle",
		data() {
			return {

			};
		},
		methods: {
			...mapMutations('m_cart', ['updataAllGoodsState']),
			changeAllState() {
				this.updataAllGoodsState(!this.isFullCheck)
			}
		},
		computed: {
			...mapGetters('m_cart', ['checkedGoodsAmount', 'checkedCount', 'total']),
			isFullCheck() {
				return this.total === this.checkedCount
			}
		}
	}
</script>

<style lang="scss">
	.my-settlt-contaitor {
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: fixed;
		height: 50px;
		bottom: 0%;
		left: 0;
		right: 0;
		background-color: white;
		font-size: 14px;
		padding-left: 5px;

		.radio {
			display: flex;
			align-items: center;
		}

		.amount-box {
			.amount {
				color: #c00000;
				font-weight: bold;
			}
		}

		.btn-settle {
			background-color: #c00000;
			color: white;
			height: 50px;
			min-width: 100px;
			text-align: center;
			padding: 0 10px;
			line-height: 50px;
		}


	}
</style>
